
#include "rtc.h"
#include "video-graphics.h"
#include "utypes.h"
#include "sprite.h"
#include "pixmap.h"
#include "queue.h"
#include "stack.h"
#define UpKey 0x48
#define DownKey 0x50
#define LeftKey 0x4b
#define RightKey 0x4d
#define frameThickness 7
#define enemyBallSpriteSpeed 8
#define enemyBallASpriteSpeed 350
#define enemyXDiameter 8
#define enemyYDiameter 5
#define ConqueredColor WHITE
#define TrailColor BLUE
#define TopFrame 30

typedef struct {
	char nome[255];
	int pontua;
} Pontuacoes;

int ** gameMat;

//Queue keys_queue;


void initializeGameArea(int level,char * video_base);
void moveEnemy(char * video_base);
enum matPositions{ unconqueredPosition, conqueredPosition, enemyBallPosition, playerTrail};
enum gameState{ Menu,Begin, Playing, EnemyMoving,PlayerMoving,PlayerCrashed,NextLevel,BeginLevel,Waiting,End} gState,waitState;
enum playerMovement{UP,DOWN,LEFT,RIGHT};
void gameControl(char * video_base);
void paint(int x,int y,char* video_base);
void fillArea(char*  video_base);
void floodFill(int x,int y,char * video_base);
int isHighScore(Pontuacoes * p);
void restartPosition();
Pontuacoes *read_pontuacoes();
void write_pontuacoes(Pontuacoes pontuacao[]);
void printGameMatrix();
void checkHighScore(char * video_base);

Sprite ** enemySprite;
Sprite * playerSprite;

int conqueredArea;
int totalArea;
int enemyNumber;
int level;
int endGame;
int lives;
int isOut;
float winPercentage;
extern volatile int tempo_pont;
extern char name[255];
